package com.quarantine.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springside.modules.orm.Page;

import com.quarantine.dao.fileuploadDao;
import com.quarantine.model.fileupload;


@Component
@Transactional
public class FileUploadManager {

	
	private fileuploadDao fileuploadDao;

    public fileuploadDao getFileuploadDao() {
		return fileuploadDao;
	}
    @Autowired
	public void setFileUploadDao(fileuploadDao fileuploadDao) {
		this.fileuploadDao = fileuploadDao;
	}
	/**
     * 根据id查找
     */
    @Transactional  
	public fileupload getById(String id) {
		return fileuploadDao.findUniqueBy("id", id);
	}
//    @Transactional
//    public fileupload getEntity(String check){
//    	return fileuploadDao.findUniqueBy("check1",check);
//    }
    @Transactional  
    public void set(fileupload entity){
    	fileuploadDao.save(entity);
    }
    @Transactional      
    /**
     * 根据id来删除
     */
    public void delete(String id){
    	fileuploadDao.delete(id);
    }
    
    
    /***
     * 显示文件列表
     * @param page
     * @return
     */
    @Transactional 
    public Page<fileupload> getList(final Page<fileupload>page ) {
	return fileuploadDao.findPage(page, "from fileupload order by input_time desc");
}
}
